package epoch.db.cmd;

import java.util.List;

import epoch.db.gamedb.Entity;

public class EntityCommand extends DBCommand{
	
	public List<Entity> entityList;
	public Entity entity;

	@Override
	protected void onDestroy() {
		if(entityList!=null){
			entityList.clear();
			entityList=null;
		}
		entity=null;
	}

	@Override
	public DBCommandType getType() {
		return DBCommandType.EntityCmd;
	}

	@Override
	public void execute() {
		if(optType==DBCommand.INSERT){
			dataAccess.insert(entity);
		}
	}
}
